﻿using UnityEngine;
using System.Collections;
using DG.Tweening;

public class UICloseSc : MonoBehaviour
{

    public Transform btn;
	// Use this for initialization
	void Start ()
	{
	    btn = transform.FindChild("Button");
	    if (btn==null)
	    {
            btn = transform.FindChild("CloseBtn");
        }
	    if (btn != null)
	    {
            EventTriggerListener.Get(btn.gameObject).onClick = OnClick;


        }
    }

    void OnClick(GameObject obj)
    {
        //
        transform.localScale = new Vector3(1, 1, 1);
        Tweener tw = transform.DOScale(new Vector3(0, 0, 0), 0.3f).SetEase(Ease.OutBack);

    }
    // Update is called once per frame
    void Update () {
	
	}
}
